package onnxruntime

import (
	"errors"
	"fmt"
)

var ErrorNotInitialized error = errors.New("initializeRuntime() has either not yet been called, or did not return successfully")

var ErrorZeroShapeLength error = errors.New("the shape has no dimensions")

var ErrorShapeOverflow error = errors.New("the shape's flattened size overflows an int64")

// This type of error is returned when we attempt to validate a tensor that has
// a negative or 0 dimension.
type BadShapeDimensionError struct {
	DimensionIndex int
	DimensionSize  int64
}

func (e *BadShapeDimensionError) Error() string {
	return fmt.Sprintf("dimension %d of the shape has invalid value %d",
		e.DimensionIndex, e.DimensionSize)
}
